<?php defined('SYSPATH') or die('No direct access allowed.');

class Controller_Page extends Controller_ClientTemplate
{
    public function action_index()
    {
        $name = Request::$current->param('name', '');
        
        if($name != ''){
            $page = DB::query(Database::SELECT, 'SELECT * FROM `pages`
                                                 WHERE `name`=:name
                                                 LIMIT 1')
                      ->param(':name', $name)
                      ->as_object()
                      ->execute()
                      ->current();
            if($page){
                $this->template->title = $page->html_title;
                $this->template->keywords = $page->html_keyword;
                $this->template->description = $page->html_description;
                $this->template->content = $page->content;
            }
        }
    }
}